<?php

namespace app\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/** 
 * This is the model class for table "wx_form_click_record". 
 * 
 * @property string $id
 * @property string $openid openid
 * @property string $identifier 商户标识
 * @property string $redirect_url webform地址
 * @property int $clicks 点击量
 * @property int $status 1为点击,2为注册
 * @property int $created_at 创建日期
 * @property int $updated_at 更新日期
 */ 

class FormClickRecord extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'wx_form_click_record';
    }

    /** 
     * @inheritdoc 
     */ 
    public function rules() 
    { 
        return [
            [['openid', 'identifier', 'redirect_url'], 'required'],
            [['clicks', 'status', 'created_at', 'updated_at'], 'integer'],
            [['openid', 'identifier'], 'string', 'max' => 64],
            [['redirect_url'], 'string', 'max' => 255],
        ]; 
    }

    /** 
     * @inheritdoc 
     */ 
    public function attributeLabels() 
    { 
        return [ 
            'id' => 'ID',
            'openid' => 'Openid',
            'identifier' => 'tenant标识符',
            'redirect_url' => '重定向',
            'clicks' => '点击次数',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ]; 
    } 

     /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::className(),
        ];
    }
}
